{block name="style"}
{/block}
{block name="content"}
<div class="info-header">
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">采购单号</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.purchase_sn}" readonly class="layui-input copy-text">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">供应商</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.producer.name}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">供应商单号</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.producer_sn}" readonly class="layui-input copy-text">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">采购人</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.buyer.nickname}" readonly class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.order_status}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">支付状态</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.pay_status}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">付款方式</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.pay_type}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">账期</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.credit_day}天" readonly class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">已付金额</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.pay_money|abs}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">采购金额</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.amo_money|abs}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">运费</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.logistics_price|abs}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">总金额</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.total_money|abs}" readonly class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">供应商优惠</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.pro_money|abs}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">税</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.tax|abs}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">下单时间</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.business_date}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">交货日期</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.delivery_date}" readonly class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">预计到货</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.estimate_date}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">到货日期</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.recv_date}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">完成日期</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.finish_date}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">调入仓库</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.warehouse.name}" readonly class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-sm3">
            <label class="layui-form-label">收货人</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.contacts}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-sm3">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.phone}" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-col-xs6">
            <label class="layui-form-label">收货地址</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.address}" readonly class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs3">
            <label class="layui-form-label">备注信息</label>
            <div class="layui-input-block">
                <input type="text" value="{$purchase.remark}" readonly class="layui-input">
            </div>
        </div>
    </div>
</div>
<div class="info-body">
    <div class="layui-form-item job-flow-margin">
        {include file="public/attachment" /}
    </div>
    {if $purchase->getData('check_status') != \app\common\model\JobFlowModule::CHECK_NO_NEED}
    <div class="layui-row job-flow-margin">
        {include file="public/jobFlow" /}
    </div>
    {/if}
    <div class="layui-row">
        <h2>商品详情</h2>
        <table class="layui-table text-center">
            <thead>
            <tr>
                <th>图片</th>
                <th>名称</th>
                <th>SKU</th>
                <th>数量</th>
                <th>单位</th>
                <th>单价</th>
                <th>总价</th>
                <th>到货数量</th>
                <th>入库数量</th>
                <th>未入库数量</th>
                <th>退货数量</th>
                <th>异常数量</th>
                <th>状态</th>
                <th>采购链接</th>
                <th>备注</th>
            </tr>
            </thead>
            <tbody>
            {foreach $purchase->info as $info}
            <tr>
                <td width="100"><img src="{$info.image_url}"></td>
                <td class="text-left">{$info.name_ch}</td>
                <td class="copy-text">{$info.sku}</td>
                <td>{$info.qty}</td>
                <td>{$info.unit}</td>
                <td>{$info.price|abs}</td>
                <td>{$info.qty * $info.price|abs}</td>
                <td>{$info.store_qty}</td>
                <td>{$info.stock_qty}</td>
                <td>{$info.n_store_qty}</td>
                <td>{$info.return_qty}</td>
                <td>{$info.exce_qty}</td>
                <td>{$info.store_status}</td>
                <td>{if !empty($info.url)}<a target="_blank" href="{$info.url}"><i class="layui-icon layui-icon-link"></i></a>{/if}</td>
                <td class="text-left">{$info.remark}</td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
</div>
{/block}
{block name="script"}
{/block}